package cn.edu.xmu.server.dao.bo;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@Data
@NoArgsConstructor
@Builder
public class ChatMsg implements Serializable {

    public static final String SINGLE_CHAT = "single_chat";
    public static final String GROUP_CHAT = "group_chat";

    private String sender;
    private String receiver;
    private String group_id;
    private String type;
    private String message;

    @JsonCreator
    public ChatMsg(@JsonProperty("sender") String sender,
                   @JsonProperty("receiver") String receiver,
                   @JsonProperty("group_id") String group_id,
                   @JsonProperty("type") String type,
                   @JsonProperty("message") String message) {
        this.sender = sender;
        this.receiver = receiver;
        this.group_id = group_id;
        this.type = type;
        this.message = message;
    }
}
